home *** CD-ROM | disk | FTP | other *** search
/ Invisible Universe / Invisible Universe (1995)(Voyager)[Mac-PC].iso / mac / MOVIES / SHARED.DIR / 01017_Script_sbscrollxxx < prev    next >
Text File  |  1995-11-21  |  3KB  |  124 lines

  1. -- standard quickDraw button behavior
  2. --ancestor to standard button trios [sbt]
  3. --property myChannel, myScript, ancestor, myOldCast
  4.  
  5. --on birth me, sp,sc
  6. --  set ancestor to birth(script "sb",sp,sc)
  7. --  
  8. --  set myChannel to integer(sp)
  9. --  set myOldCast = 0
  10. --  set myScript to sc
  11. --  return me
  12. --end
  13. --
  14. --change appearance
  15. on sbsnorm me
  16.   --  puppetSprite myChannel,TRUE
  17.   --  set the ink of sprite myChannel to 39
  18.   --  updateStage
  19.   --  puppetSprite myChannel, false
  20. end 
  21.  
  22. on sbsrollo myChannel, myRollover
  23.   global gTSEnabled
  24.   
  25.   if gTSEnabled then exit
  26.   
  27.   --  --put ">>>my rollover cast 1002  sb: chan=" & myChannel   
  28.   --  
  29.   set myOldCast = the castNum of sprite myChannel
  30.   set n = the name of cast myOldCast
  31.   
  32.   puppetSprite myChannel,TRUE
  33.   
  34.   if char 3 of n = "O" then
  35.     set the castNum of sprite myChannel  = cast "SCOPER.PIC"
  36.   else
  37.     set the castNum of sprite myChannel  = cast "SCROLLR.PIC"
  38.   end if
  39.   
  40.   updateStage
  41.   
  42.   puppetSprite myChannel, false
  43. end
  44.  
  45. on sbspress me
  46.   --  puppetSprite myChannel,TRUE
  47.   --  set the ink of sprite myChannel to 34
  48.   --  updateStage
  49.   --  puppetSprite myChannel, false
  50. end
  51.  
  52. on sbsdoScript theLine
  53.   global gTSEnabled, gNavPalette, gMouseDownTime, gDoRectClickP, gInsbsdoScript
  54.   
  55.   --set the trace = 1
  56.   
  57.   --  if gInsbsdoScript = 0 then 
  58.   --    set gInsbsdoScript = 1   
  59.   --  else
  60.   --    set the trace = 0
  61.   --    exit
  62.   --  end if
  63.   
  64.   if gTSEnabled then
  65.     --put ">>> delta time" && ( (the ticks) - gMouseDownTime)
  66.     
  67.     if the ticks < (gMouseDownTime + 30) then 
  68.       set the trace = 0
  69.       exit
  70.     end if
  71.     
  72.     
  73.     --    set mc = the mouseChar
  74.     set mCast = the mouseCast
  75.     set mName = the name of cast mCast
  76.     
  77.     --put ">>>castnum = " & mCast && "cast name " & mName
  78.     
  79.     set l = length(mName)
  80.     if char (l-3) to l of mName <> ".PIC" and the scriptText of cast mCast <> empty then
  81.       --put ">>>(passing to)castnum = " & mCast && "cast name " & mName
  82.       pass
  83.       --put ">>>(back)castnum = " & mCast && "cast name " & mName
  84.       set gMouseDownTime = the ticks
  85.       
  86.       if gDoRectClickP then 
  87.         set gInsbsdoScript = 0
  88.         set the trace = 0
  89.         exit
  90.       end if
  91.       
  92.     end if      
  93.     
  94.     
  95.     set gMouseDownTime = the ticks
  96.     
  97.     set gTSEnabled = 0
  98.     set the mouseDownScript to empty
  99.     tell gNavPalette to lOpenNavPalette
  100.     goMainView
  101.   else  
  102.     set gTSEnabled = 1  
  103.     
  104.     --put ">>> delta time" && ( (the ticks) - gMouseDownTime)
  105.     
  106.     tell gNavPalette to lCloseNavPalette(1)
  107.     do item 7 of theLine
  108.     set gMouseDownTime = the ticks
  109.   end if
  110.   
  111.   set gInsbsdoScript = 0
  112.   
  113.   --set the trace = 0
  114. end  
  115.  
  116. on clearHotSpotText
  117.   global gTSEnabled, gNavPalette
  118.   
  119.   set gTSEnabled = 0
  120.   --set the mouseDownScript to empty
  121.   tell gNavPalette to lOpenNavPalette
  122.   goMainView  
  123. end clearHotSpotText
  124.